home *** CD-ROM | disk | FTP | other *** search
- Instructions on how to use Genesis V2.1
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- This file describes how to use the temporary interface to the
- Genesis modelling system. The final version will incorporate a
- a complete text parsing system with which will allow models to
- be constructed in a more user friendly way, but for the mean time
- this preliminary interface is used.
-
- When you invoke Genesis you are put into a mode where anything
- you try and type in at the keyboard will be interpreted by Genesis
- as a command. Most commands take parameters which follow the
- command, if you enter a command that needs parameters but do not
- enter any the system will wait until you enter all the information
- it is expecting. If you enter a command it doesn't recognise or give
- it an invalid parameter it will respond with an appropriate error
- message. If you invoke Genesis with the name of a file it will read
- this file which should be a list of valid genesis commands. It will
- process this as if you typed it all in interactively. If it encounters
- an error it will stop processing of the file. Genesis will except
- commands in upper, lower or mixed case.
-
- INVOKE USING: Genesis <filename>
-
- Three types of command are supported:
-
- Node creation commands - When you construct a CSG model you are actually
- (N) defining a binary tree in memory, each node of
- which can be a primitive, or an expression
- combining two other nodes.
-
- Transform commands - These can be specified after any node creation
- (T) command, and are used to changed the position
- or orientation of the node just created.
-
- System commands - These control such things as opening screens,
- (S) telling the system which node in the tree
- to draw and exiting from the system etc.
-
- There now follows a reference list of valid Genesis commands. A simple
- example of a genesis model follows which will give an idea of how to
- combine these commands to build models:
-
- Command
- Command Parameters Type Description
- ~~~~~~~ ~~~~~~~~~~ ~~~~~~~ ~~~~~~~~~~~
-
- CrPlane IRRR N Parms: node_id xn yn zn
- Creates a plane at the origin where
- xn,yn,zn is a normal vector to its surface
- pointing towards the empty side of space
- CrSphere IR N Parms: node_id radius
- Creates a sphere at the origin
- CrCylind IR N Parms: node_id radius
- Creates an infinitely long cylinder at
- the origin aligned with the z axis
- CrCone IR N Parms: node_id half_angle (in degrees)
- Creates an infinitely long double cone
- at the origin aligned with the z axis
- CrEllip IRRR N Parms: node_id smx smy smz
- Creates an ellipsoid at the origin with
- the semi-major axis lengths given by
- smx, smy and smz
- CrSolid I N Parms: node_id
- Creates an entirely SOLID universe
- CrEmpty I N Parms: node_id
- Creates an entirely EMPTY universe
- CrExpr IICI N Parms: node_id node1_id expr node2_id
- Combines two nodes using an operator
- Valid operators are:
- + : Take union of nodes
- * : Take intersection of nodes
- - : Subtract node2 from node1
- Eg. CrExpr 3 1 * 2 makes node 3 equal
- to the intersection of nodes 1 and 2
- XRot R T Parms: angle (degrees)
- This is a transform type. It rotates the
- previously created node in the x axis
- YRot R T Parms: angle (degrees)
- Rotates the previously created noe in the
- y axis
- ZRot R T Parms: angle (degrees)
- Rotates the previously created noe in the
- y axis
- Trans RRR T Parms: x_offset y_offset z_offset
- Moves the previously created node and its
- sub-nodes to a new position
- Scale R T Parms: factor
- Scales the previously created node and its
- sub-nodes by a factor
- Draw I S Parms: node_id
- Draws the object at node_id on the current
- screen
- Start S S Parms: filename
- Reads subsequent commands from a file.
- NB. CANNOT BE ISSUED FROM A FILE, ie. nested
- starts are not possible
- Exit - S Parms: (No parameters)
- Exits from a command file, or if typed in
- directly, exits the Genesis system
- Open IIS S Parms: screen_id resolution colour
- Opens a screen and makes it current. The
- resolution can currently be between 4 and
- 9, (NB. size 8 means 2**8 by 2**8 or 256
- square). Colour must be one of;
- Red Cyan White
- Green Magenta Black
- Blue Yellow
- Close I S Parms: screen_id
- Closes a screen. Another will be selected
- by the system to be made current
- Screen I S Parms: screen_id
- Make a different screen current (ie. The one
- that will be rendered on).
- Reset - S Parms: (no parameters)
- Removes the entire model from memory
- Size I S Parms: size
- Sets the size of the space in which
- Genesis will render. Eg. size 8 means it
- will render a 256 x 256 x 256 cube. You
- must ensure that the current screen is at
- least this size to be able to display it.
- Camera RRR S Parms: x y z
- Sets the position of the camera
- Object RRR S Parms: x y z
- Sets the position at which the camera
- is looking
- Up RRR S Parms: x y z
- Sets the 'up' direction in the final image
- Window RRR S Parms: x y z
- Defines a box of dimensions x,y,z around
- the object position which contains
- everything that will be rendered by the
- system
- Persp S S Parms: On/Off
- Tells system wether perspective is to
- be used. Parameter must be either 'on' or
- 'off'.
- KEY:
- | R : Real value | N : Node creation command |
- | I : Integer value | T : Transform command |
- | S : String | S : System command |
- | C : Character | |
- | - : (no parameters)| |
-
- If, when rendering a model, you find you have large white areas in your
- picture, this is because part of the object being rendered comes closer
- to the camera (or viewpoint) than the front face of the universe. In other
- words Genesis will only render things within a defined volume. If this
- hasn't been changed by the use of the WINDOW, PERSP, OBJECT or CAMERA
- commands, then you will be using the default universe, which is a cube
- with its bottom, left, front corner at the origin and extending to 256
- units along the x, y and z axis. Anything within this volume will be rendered,
- but if any part of the object comes closer to the viewpoint than z=0
- (ie. negative z, as we are using a left handed coordinate system), it will
- appear as a featureless white area.
-
- The following example will construct a cube with a cylindrical hole
- drilled through the front of it;
-
- Open 0 8 blue (opens a blue size 8 screen)
-
- CrPlane 1 1 0 0 trans 1 0 0 (creates six half planes for
- CrPlane 2 -1 0 0 trans -1 0 0 the edges of the cube.
- CrPlane 3 0 1 0 trans 0 1 0 NB. Each one has a different
- CrPlane 4 0 -1 0 trans 0 -1 0 normal and is moved an
- CrPlane 5 0 0 1 trans 0 0 1 offset from the origin or
- CrPlane 6 0 0 -1 trans 0 0 -1 the centre of the cube)
-
- CrExpr 7 1 * 2 (All these half planes are
- CrExpr 8 3 * 4 intersected in a hierachy
- CrExpr 9 5 * 6 to form a cube at the origin
- CrExpr 10 7 * 8 at node 11)
- CrExpr 11 10 * 9
-
- CrCylind 12 0.5 (Creates the small cylinder)
-
- CrExpr 13 11 - 12 XRot -30 YRot 20 (Subtract it from the cube,
- Scale 30 rotate this object to get a
- Trans 128 128 128 good view, scale it to a good
- size, and then move it to the
- centre of the cube)
- Draw 13 (Draw the object at node 13)
-
- I suggest you try typing in the above to get a feel for how to use
- the system as it currently stands, or even just edit it out of this
- file and run it on the modeller (but remember to remove the comments).
- In the final version of the modeller all this will be able to be
- replaced by;
-
- Open 0 8 blue
- Draw (
- Cube(1,1,1) subtract Cylinder(0.5)
- ) XRot(-30) YRot(20) Scale(30) At(128,128,128).
-